// Copyright NaChuanSoftware Author(https://github.com/LiuShuKu). All Rights Reserved.

// Copyright (c)  2023 LiuShuKu
// Project Name :   balance
// Author       :   liushuku@yeah.net

// Package domain .
package domain

// Trc20Detail 数据详情
type Trc20Detail struct {
	Address    string
	PrivateKey string
}

// TronTransactionDetail Trx 交易数据详情
type TronTransactionDetail struct {
	From    string `json:"from"`    // 发送方
	To      string `json:"to"`      // 接收方
	Amount  string `json:"amount"`  // 交易金额 单位: 元
	HashKey string `json:"hashKey"` // 钱包私钥
}

// TrxTransactionDetails Trx交易详情
type TrxTransactionDetails struct {
	ContractRet   string `json:"contractRet"`
	Confirmed     bool   `json:"confirmed"`
	Block         int    `json:"block"`
	Timestamp     int64  `json:"timestamp"`
	Confirmations int    `json:"confirmations"`
	Hash          string `json:"hash"`
	ContractData  struct {
		Amount       int    `json:"amount"`
		OwnerAddress string `json:"owner_address"`
		ToAddress    string `json:"to_address"`
	} `json:"contractData"`
}

// UsdtTransactionDetails usdt 交易详情
type UsdtTransactionDetails struct {
	ContractRet       string `json:"contractRet"`
	Confirmed         bool   `json:"confirmed"`
	Trc20TransferInfo []struct {
		IconURL         string `json:"icon_url"`
		Symbol          string `json:"symbol"`
		Level           string `json:"level"`
		ToAddress       string `json:"to_address"`
		ContractAddress string `json:"contract_address"`
		Type            string `json:"type"`
		Decimals        int    `json:"decimals"`
		Name            string `json:"name"`
		Vip             bool   `json:"vip"`
		TokenType       string `json:"tokenType"`
		FromAddress     string `json:"from_address"`
		AmountStr       string `json:"amount_str"`
		Status          int    `json:"status"`
	} `json:"trc20TransferInfo"`
	Timestamp    int64  `json:"timestamp"`
	Hash         string `json:"hash"`
	ContractData struct {
		OwnerAddress    string `json:"owner_address"`
		ContractAddress string `json:"contract_address"`
	} `json:"contractData"`
}

// UsdtTransactionDetailListData usdt 交易详情列表
type UsdtTransactionDetailListData struct {
	Total          int               `json:"total"`
	RangeTotal     int               `json:"rangeTotal"`
	TokenTransfers []*TokenTransfers `json:"token_transfers"`
}
type TokenInfo struct {
	TokenID      string `json:"tokenId" `
	TokenAbbr    string `json:"tokenAbbr"`
	TokenName    string `json:"tokenName"`
	TokenDecimal int    `json:"tokenDecimal"`
	TokenCanShow int    `json:"tokenCanShow"`
	TokenType    string `json:"tokenType"`
	TokenLogo    string `json:"tokenLogo"`
	TokenLevel   string `json:"tokenLevel"`
	IssuerAddr   string `json:"issuerAddr"`
	Vip          bool   `json:"vip"`
}
type TokenTransfers struct {
	TransactionID         string    `json:"transaction_id"`
	Status                int       `json:"status"`
	BlockTs               int64     `json:"block_ts"`
	FromAddress           string    `json:"from_address"`
	ToAddress             string    `json:"to_address"`
	Block                 int       `json:"block"`
	ContractAddress       string    `json:"contract_address"`
	Quant                 string    `json:"quant"`
	Confirmed             bool      `json:"confirmed"`
	ContractRet           string    `json:"contractRet"`
	FinalResult           string    `json:"finalResult"`
	Revert                bool      `json:"revert"`
	TokenInfo             TokenInfo `json:"tokenInfo"`
	ContractType          string    `json:"contract_type"`
	FromAddressIsContract bool      `json:"fromAddressIsContract,omitempty"`
	ToAddressIsContract   bool      `json:"toAddressIsContract,omitempty"`
	RiskTransaction       bool      `json:"riskTransaction,omitempty"`
}
